<template>
  <div>


      <!-- 多条件查询 -->
      <!-- <el-form ref="employee" :model="employee" label-width="80px" :inline="true">
          <el-form-item label="标题">
              <el-input v-model="employee.aname"></el-input>
          </el-form-item>



          <el-form-item>
              <el-button type="success" plain @click="getALLEmployeeButton">查询</el-button>

          </el-form-item>
      </el-form> -->

      <!-- 表格 -->
      <el-table :data="pageBean.beanList" border style="width: 100%">

          <el-table-column prop="aid" label="编号" width="100">
          </el-table-column>
          <el-table-column prop="aname" label="标题" width="100">
          </el-table-column>

          <el-table-column prop="classfiy.ssname" label="分类">
          </el-table-column>


          <el-table-column prop="cell.cname" label="小区">
          </el-table-column>


          <el-table-column prop="starttime" label="发布时间">
          </el-table-column>


          <el-table-column prop="status" label="状态">
          </el-table-column>

          <el-table-column prop="content" label="内容">
          </el-table-column>



          <el-table-column prop="publisher" label="发布人">
          </el-table-column>

          <el-table-column prop="istop" label="是否置顶">
          </el-table-column>

          <!-- 操作 -->
          <el-table-column label="操作" width="150">
              <template slot-scope="scope">
                  <el-button size="mini" @click="handleEdit(scope.$index, scope.row)">修改</el-button>
                  <el-button type="danger" plain size="small" @click="del(scope.row.sid)">删除</el-button>
              </template>
          </el-table-column>

      </el-table>

      <!-- 分页 -->
      <div class="block">
          <span class="demonstration"></span>
          <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
              :current-page="pageIndex" :page-sizes="[1, 2, 3 ]" :page-size="pageSize"
              layout="total, sizes, prev, pager, next, jumper" :total="pageBean.totalRecord">
          </el-pagination>
      </div>



  </div>
</template>
<script>
  export default {
      data() {
          return {
              pageBean: {},
              pageIndex: 1,
              pageSize: 3,
              classfiy: [],
              employee: { },
          }
      },
      mounted() {
          this.getALLAdvertised();
          // this.getALLDepartment();
      },
      methods: {




          //按钮查询
          getALLEmployeeButton() {
              this.pageSize = 1
              this.getALLAdvertised();
          },
          handleSizeChange(val) {
              this.pageSize = val
              //重新查询
              this.getALLAdvertised()
          },
          //索引页改变
          //val是当前页码
          handleCurrentChange(val) {
              this.pageIndex = val
              this.getALLAdvertised()
          },
          getALLAdvertised(page) {
              this.$axios.post('/advert/getAll/' + this.pageIndex + "/" + this.pageSize, this.employee).then(resp => {
                  console.log(resp.data.data);
                  this.pageBean = resp.data.data;

              })
          },
      }
  }

</script>
<style scoped>

</style>